Skip to content

[#396] Batch TradingWidget RPC calls + reduce polling#398

Merged
realproject7 merged 1 commit intomainfrom
task/396-trading-rpc-batch
Mar 20, 2026
Merged

[#396] Batch TradingWidget RPC calls + reduce polling#398
realproject7 merged 1 commit intomainfrom
task/396-trading-rpc-batch

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Combine balance + estimate into a single multicall RPC request (2 individual calls → 1)
  • Reduce polling from 15s to 60s
  • Estimate only included in multicall when amount is entered (no idle polling)
  • Balance still refreshes after trade completion via refetchTradeData()

Fixes #396

Test plan

  • npm run typecheck — passes
  • npm run lint — passes
  • Manual: no 429 errors on story detail page

🤖 Generated with Claude Code

Combine balance + estimate queries into a single multicall request
(2 individual calls → 1 RPC request). Reduce polling from 15s to
60s. Estimate only fetched when amount is entered (no idle polling).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Balance + estimate combined into single multicall, polling reduced from 15s to 60s, estimate conditionally included. CI green.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The PR matches issue #396: TradingWidget now batches balance and estimate into one multicall, only includes the estimate call when an amount is present, and reduces polling to 60 seconds. The required lint/typecheck check is green.

Findings

  • None.

Decision

Approve because the implementation is focused, follows the accepted browser client pattern, and satisfies the issue acceptance criteria.

@realproject7 realproject7 merged commit 67cd9ce into main Mar 20, 2026
1 check passed
@realproject7 realproject7 deleted the task/396-trading-rpc-batch branch March 20, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Story detail page fires repeated RPC calls — needs batching or debounce

2 participants